<base href="<?php echo base_url();?>" />
<link rel="stylesheet" href="assets/style.css" type="text/css" media="screen"/>

<!--    ######################################   -->

<?php
echo validation_errors(); 
echo form_open('notenskala_controller/set_notenskala');
echo "<input type='input' name='notencode' hidden='true' value='".$notencode."'/>";
echo "<table>
		<thead>
	    	<tr>
		      	<th class='sorter-false'>Note </th>
		      	<th class='sorter-false'>AbProzent </th>
	    	</tr>
		</thead>
		<tbody>";  
	  $post = false;
	  for ($i=15; $i > 0; $i--) {
	  		echo "<tr>
	  				<td>
	  					<input type='input' name='Note[".$i."]' disabled='disabled' value='".$i."'/>
	  				</td>
					<td>"; 
		  foreach ($notenskala as $row) {
			  if ($row['Note'] == $i) {
			  			echo "<input type='input' name='AbProzent[".$i."]' disabled='disabled' value='".$row['AbProzent']."'/>";
			  	$post = true;
			  }
		  }
		  if ($post == false) {
		  		echo"<input type='input' name='AbProzent[".$i."]' disabled='disabled' value=''/>";
		  }
		  echo "</td>
		  		<tr>";
	 }
 echo "</tbody>
	</table>";
?>
    
<script>
$(document).ready(function() 
    { 
	    $("table").tablesorter({ 
	        // pass the headers argument and assing a object 
	 
	        theme: 'green',
	        widthFixed: true, 
	        widgets: ['zebra'] 
	    })
    }   
); 
</script>